<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>this的指向</title>
	<link rel="stylesheet" href="">
</head>
<body>
	<input type="text">
	<script>
		var ipt = document.getElementsByTagName('input')
		function fn() {
			console.log(this)
			// 普通函数指向window对象
		}
		fn()

		var Fun = function() {
			console.log(this)
			//  函数表达式指向window对象
		}
		Fun()

		function fn1() {
			"use strict"
			console.log(this)
			//  严格模式下this指向undefined
		}
		fn1()

		var person = {
			'username': 'dog',
			'age': 10,
			f1 : function() {
				console.log(this)
				//  this指的是这个对象
			}
		}
		person.f1();
	</script>
</body>
</html>